package com.kalvan.web.feign.client;

import com.kalvan.client.model.Request;
import com.kalvan.client.model.Response;
import com.kalvan.web.feign.client.fallback.SccApiFallbackFactory;
import com.kalvan.web.feign.client.req.DictRequest;
import com.kalvan.web.feign.client.res.DictResponse;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import java.util.List;

/**
 * 服务控制
 *
 * @author chenliang
 */
@FeignClient(name = "scc", path = "scc",
        fallbackFactory = SccApiFallbackFactory.class)
public interface SccDictClient {
    /**
     * 获取字典
     *
     * @param request 请求入参
     * @return 对应dictType的所有字典, 字典建议客户端本地做jetcache
     */
    @RequestMapping(value = "/dict/get", method = RequestMethod.POST)
    Response<List<DictResponse>> getDict(@RequestBody Request<DictRequest> request);
}
